package com.cloudsigns.factorymanager2.produce.activity.produce_team;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.cloudsigns.factorymanager2.BaseActivity;
import com.cloudsigns.factorymanager2.R;

public class ProduceTeamEditHandoverInformationActivity extends BaseActivity {
    private RelativeLayout rl_back;
    private TextView tv_title;
    private EditText edt_submit_num;
    private EditText edt_receive_team, edt_receive_people;
    private ImageView img_receive_team, img_receive_people;
    private EditText edt_compeleted_num;
    private EditText edt_product_manage;
    private ImageView img_product_manage;
    private Button btn_submit;

    @Override
    protected void onBaseCreate(Bundle savedInstanceState) {
        setContentView(R.layout.layout_produce_team_edit_handover_information);
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        rl_back = findViewById(R.id.rl_back);
        tv_title = findViewById(R.id.tv_title);
        edt_submit_num = findViewById(R.id.edt_submit_num);
        edt_receive_team = findViewById(R.id.edt_receive_team);
        edt_receive_people = findViewById(R.id.edt_receive_people);
        img_receive_team = findViewById(R.id.img_receive_team);
        img_receive_people = findViewById(R.id.img_receive_people);
        edt_compeleted_num = findViewById(R.id.edt_compeleted_num);
        edt_product_manage = findViewById(R.id.edt_product_manage);
        img_product_manage = findViewById(R.id.img_product_manage);
        btn_submit=findViewById(R.id.btn_submit);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        tv_title.setText(getResources().getString(R.string.edit_submit_information));
    }

    @Override
    public void setListener() {
        rl_back.setOnClickListener(this);
        img_receive_team.setOnClickListener(this);
        img_receive_people.setOnClickListener(this);
        img_product_manage.setOnClickListener(this);
        btn_submit.setOnClickListener(this);
    }

    @Override
    public void widgetClick(View view) {
        switch (view.getId()) {
            case R.id.rl_back:
                finish();
                break;
            // 接收班组
            case R.id.img_receive_team:
                break;
            // 接收人
            case R.id.img_receive_people:
                break;
            // 生产管理
            case R.id.img_product_manage:
                break;
                // 提交
            case R.id.btn_submit:
                if (TextUtils.isEmpty(edt_submit_num.getText().toString())){
                    showToast(getResources().getString(R.string.input_submit_num));
                    return;
                }else if (TextUtils.isEmpty(edt_receive_team.getText().toString())){
                    showToast(getResources().getString(R.string.choose_receive_team));
                    return;
                }else if (TextUtils.isEmpty(edt_receive_people.getText().toString())){
                    showToast(getResources().getString(R.string.choose_receive_people));
                    return;
                }else if (TextUtils.isEmpty(edt_compeleted_num.getText().toString())){
                    showToast(getResources().getString(R.string.input_workpart_compeleted_num));
                    return;
                }else if (TextUtils.isEmpty(edt_product_manage.getText().toString())){
                    showToast(getResources().getString(R.string.choose_production_management));
                    return;
                }else{

                }
                break;
        }
    }
}
